<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>v-show</title>
</head>
<body>

  <div id="app">
    <input @click="changeIsShow" type="button" value="切换显示状态">
    <input @click="addAge" type="button" value="累加年龄">
    <input @click="subAge" type="button" value="累减年龄">
    <img alt="" src="../img/需求.png" v-show="isShow">
    <img alt="" src="../img/需求.png" v-show="age > 18">
  </div>

</body>
<!--<script src="js/vue.js"></script>-->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

<script>

  var app = new Vue({
    el: "#app",
    data: {
      isShow: true,
      age: 17
    },
    methods: {
      changeIsShow: function () {
        this.isShow = !this.isShow;
      },
      addAge: function () {
        this.age++;
      },
      subAge: function () {
        this.age--;
      }
    }

  });
</script>
</html>
